package com.com.typhoon.controller;

import com.com.typhoon.dao.User2Dao;
import com.com.typhoon.entity.User;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author shuya | dongfeng.zdf@alibaba-inc.com
 * @description
 * @date 2018-12-14 11:30 Friday
 * @description
 * @modified by
 * @since V2.0.0
 */
@RestController
@Slf4j
public class IndexController {

    @Autowired
    private User2Dao user2Dao;


    @GetMapping("/hello")
    public String hello() {
        log.info("print log ,string={}","hello");
        return "hello";
    }

    @GetMapping("/users")
    public List<User> list() {
        return this.user2Dao.findAll();
    }

}
